package com.common.controller;

import com.common.enums.sys.WhetherEnum;
import com.common.enums.user.*;
import com.core.enums.CoreEnum;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author: stefanie-zy
 * @time: 2024/1/27-9:36
 * @description: 枚举控制层
 */
@Tag(name = "枚举接口")
@ApiSort(1)
@RequestMapping(value = "/api-enum")
@RequiredArgsConstructor
@RestController
@Slf4j
@ApiSupport(author = "stefanie-zy", order = 1)
public class EnumController {

    @ApiOperationSupport(order = 1)
    @Operation(summary = "系统-是否标记")
    @GetMapping("/sys-whether")
    public List<Map<Integer, String>> listWhether() {
        return CoreEnum.getEnumList(WhetherEnum.class);
    }

    @ApiOperationSupport(order = 2)
    @Operation(summary = "用户-登录状态")
    @GetMapping("/user-loginStatus")
    public List<Map<Integer, String>> listLoginStatus() {
        return CoreEnum.getEnumList(LoginStatusEnum.class);
    }

    @ApiOperationSupport(order = 3)
    @Operation(summary = "用户-密码等级")
    @GetMapping("/user-passwordLevel")
    public List<Map<Integer, String>> listPasswordLevel() {
        return CoreEnum.getEnumList(PasswordLevelEnum.class);
    }

    @ApiOperationSupport(order = 4)
    @Operation(summary = "用户-性别")
    @GetMapping("/user-sex")
    public List<Map<Integer, String>> listSex() {
        return CoreEnum.getEnumList(SexEnum.class);
    }

    @ApiOperationSupport(order = 5)
    @Operation(summary = "用户-用户状态")
    @GetMapping("/user-status")
    public List<Map<Integer, String>> listUserStatus() {
        return CoreEnum.getEnumList(UserStatusEnum.class);
    }

    @ApiOperationSupport(order = 6)
    @Operation(summary = "用户-用户类型")
    @GetMapping("/user-type")
    public List<Map<Integer, String>> listUserType() {
        return CoreEnum.getEnumList(UserTypeEnum.class);
    }

    @ApiOperationSupport(order = 7)
    @Operation(summary = "菜单-菜单等级")
    @GetMapping("/menu-level")
    public List<Map<Integer, String>> listMenuLevel() {
        return CoreEnum.getEnumList(MenuLevelEnum.class);
    }

    @ApiOperationSupport(order = 8)
    @Operation(summary = "菜单-菜单状态")
    @GetMapping("/menu-status")
    public List<Map<Integer, String>> listMenuStatus() {
        return CoreEnum.getEnumList(MenuStatusEnum.class);
    }

    @ApiOperationSupport(order = 9)
    @Operation(summary = "菜单-菜单类型")
    @GetMapping("/menu-type")
    public List<Map<Integer, String>> listMenuType() {
        return CoreEnum.getEnumList(MenuTypeEnum.class);
    }

    @ApiOperationSupport(order = 10)
    @Operation(summary = "菜单-隐藏状态")
    @GetMapping("/menu-visible")
    public List<Map<Integer, String>> listMenuVisible() {
        return CoreEnum.getEnumList(MenuVisibleEnum.class);
    }

    @ApiOperationSupport(order = 11)
    @Operation(summary = "机构-机构等级")
    @GetMapping("/org-level")
    public List<Map<Integer, String>> listOrgLevel() {
        return CoreEnum.getEnumList(OrgLevelEnum.class);
    }

    @ApiOperationSupport(order = 12)
    @Operation(summary = "机构-机构类型")
    @GetMapping("/org-type")
    public List<Map<Integer, String>> listOrgType() {
        return CoreEnum.getEnumList(OrgTypeEnum.class);
    }
}
